package com.ctgu.springboot.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ctgu.springboot.entity.ProInfo;
import com.ctgu.springboot.service.ProInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cs
 * @since 2023-07-07
 */
@RestController
@RequestMapping("/pro-info")
public class ProInfoController {
    @Autowired
    private ProInfoService proInfoService;
    //实训流程列表
    @RequestMapping("list")
    public List<ProInfo> list(){
        return proInfoService.list();
    }
    //根据实训项目id查找对应实训流程
    @RequestMapping("seachtraid")
    public List<ProInfo> seachtraid(int tra_id){
        QueryWrapper<ProInfo> proInfoQueryWrapper=new QueryWrapper<>();
        proInfoQueryWrapper.eq("tra_id",tra_id);
        return proInfoService.list(proInfoQueryWrapper);
    }

}
